package com.umakr.ax.security.web;

import com.baomidou.mybatisplus.plugins.Page;
import com.umakr.ax.security.model.Res;
import com.umakr.ax.security.service.ResService;
import com.umakr.ax.security.service.RoleService;
import com.umakr.ax.security.service.UserRoleService;
import com.umakr.ax.security.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author gx
 * @since 2017/5/15
 */
@Controller
@RequestMapping("/api/system/resource")
public class PermissionResController {
    @Autowired
    UserService userService;
    @Autowired
    RoleService roleService;
    @Autowired
    UserRoleService userRoleService;
    @Autowired
    ResService resService;


    /**
     * (H-F)21
     * @return 结果
     */
    @ApiOperation("查询资源")
    @RequestMapping("/resourceList")
    @ResponseBody
    public Object resourceList(Integer pageSize,Integer page){

        Page<Res> pageRes = new Page<>(page,pageSize);
        resService.selectPage(pageRes);
        Map<String,Object> map = resService.resultMap(1,"");
        map.put("data",pageRes);
        return map;
    }

}
